package co.fitstart.entity.user.agent;

import com.demo2do.core.utils.Alias;

@Alias(value = "recordType")
public enum RecordType {
    
    EARNED("earned", "已赚取"),
    
    WITHDRAWING("withdrawing", "待提现"),
    
    WITHDRAWED("withdrawed", "已提现");
    
    private String alias;
    
    private String description;
    
    private RecordType(String alias, String description) {
        this.alias = alias;
        this.description = description;
    }
    
    /**
     * 
     * @return
     */
    public boolean isWithdrawing() {
        return this.equals(WITHDRAWING);
    }
    
    /**
     * 
     * @return
     */
    public boolean isWithdrawed() {
        return this.equals(WITHDRAWED);
    }
    
    /**
     * 
     * @param alias
     * @return
     */
    public static RecordType aliasOf(String alias) {
        for (RecordType recordType : RecordType.values()) {
            if (recordType.getAlias().equalsIgnoreCase(alias)) {
                return recordType;
            }
        }
        
        return null;
    }
    
    /**
     * @return the alias
     */
    public String getAlias() {
        return alias;
    }

    /**
     * @return the description
     */
    public String getDescription() {
        return description;
    }

    /**
     * @param alias the alias to set
     */
    public void setAlias(String alias) {
        this.alias = alias;
    }

    /**
     * @param description the description to set
     */
    public void setDescription(String description) {
        this.description = description;
    }
    
    

}
